<template>
    <div>
        <a-modal
            title="申请事项审批表打印"
            :visible="visible"
            @ok="visible = false"
            @cancel="visible = false"
            :footer="null"
            class="administrativeOffice-print-modal"
            :width="794+48+16"
        >
            <div style="width: 794px;">
                <div>
                    <a-button class="blue-btn" type="primary" v-print="printObj">打印</a-button>
                </div>
                <div id="administrativeOffice-print-ID">
                    <!-- <div v-for="(item,index) in printList" :key="index" class="administrativeOffice-print-div">
                        <h1 class="table-title">xx壮族自治区食品药品审评查验中心<br/>申请事项审批表</h1>
                        <table border="1" cellspacing="0" class="table-Lu gwcc-table">
                            <tr>
                                <th>时间</th>
                                <td>{{ moment(item.frq).format('YYYY-MM-DD') }}</td>
                                <th>自然编号</th>
                                <td> {{ item.fzrbh }} </td>
                            </tr>
                            <tr>
                                <th>科室</th>
                                <td>{{ item.fks }}</td>
                                <th>类别</th>
                                <td>{{ item.flb.toString() }}</td>
                            </tr>
                            <tr>
                                <th>事项名称</th>
                                <td colspan="3" class="text-align-left">
                                    {{ item.fsx }}
                                </td>
                            </tr>
                            <tr>
                                <th>具体内容</th>
                                <td colspan="3" class="text-align-left">
                                    {{ item.fnbyj }}
                                </td>
                            </tr>
                            <tr>
                                <th>主办科室意见</th>
                                <td colspan="3">
                                    <div>
                                        <p class="text-align-left">{{ item.fksldyj }}</p>
                                        <div class="yjqm-right-bottom">
                                            <img v-if="getUrl('科室审核')" :src="getUrl('科室审核')" class="yjqmImg"/>
                                            <span v-else class="yjqmImg">{{ item.fksldyjr }}</span>
                                            <span>{{ item.fksldyjsj }}</span>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <th>中心分管领导<br/>意见</th>
                                <td colspan="3">
                                    <div>
                                        <p class="text-align-left">{{ item.ffgldyj }}</p>
                                        <div class="yjqm-right-bottom">
                                            <img v-if="getUrl('中心分管领导审核')" :src="getUrl('中心分管领导审核')" class="yjqmImg"/>
                                            <span v-else class="yjqmImg">{{ item.ffgldyjr }}</span>
                                            <span>{{ item.ffgldyjsj }}</span>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <th>中心主要领导<br/>批示</th>
                                <td colspan="3">
                                    <div>
                                        <p class="text-align-left">{{ item.fzxld }}</p>
                                        <div class="yjqm-right-bottom">
                                            <img v-if="getUrl('中心领导审核')" :src="getUrl('中心领导审核')" class="yjqmImg"/>
                                            <span v-else class="yjqmImg">{{ item.fzxldpsr }}</span>
                                            <span>{{ item.fzxldpssj }}</span>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <th>备注</th>
                                <td colspan="3">
                                    {{item.fbz}}
                                </td>
                            </tr>
                        </table>
                        <div style="page-break-after:always"></div>
                    </div> -->
                    <tableModule :printList="printList" :qmImgList="qmImgList"/>
                </div>
            </div>
        </a-modal>
    </div>
</template>
<script>
import {
    downMyQm,
} from './service/index'
import moment from 'moment'
import tableModule from './tableModule'
export default {
    components:{
        tableModule
    },
    props:{

    },
    data(){
        return{
            moment:moment,
            visible:false,
            formState:{},
            printList: [],
            qmImgList: [],
            laborCostsList: [],
            printObj:{
                id:"administrativeOffice-print-ID", //需要打印的id名称
                popTitle:"行政申请事项审批表",//文档的名称
                // preview:true,//预览功能，不好用
                zIndex:'20002',
                beforeOpenCallback(vue){
                    //console.log('打印回调',vue)
                },
                openCallback (vue) {//打开之前
                    //console.log('打开之前',vue)
                },
                closeCallback (vue) {//关闭了打印工具
                    //console.log('关闭了打印工具')
                },
            },
        }
    },
    watch:{

    },
    mounted(){

    },
    methods:{
        getData(val,qmVal){
            this.printList = []
            this.qmImgList = []
            typeof val == 'object' ? this.printList.push(val):this.printList = val
            this.qmImgList = qmVal
            //console.log('打印数据',this.printList)
        },
        printClick(){

        },
        // 签名图片
        getUrl(hjmcName){
            let url = ''
            this.qmImgList.forEach(item => {
                if(item.hjmc == hjmcName){
                    url = item.url
                }
            })
            return url
        },
    }
}
</script>
<style lang="less">
@import url('../css/oaLess.css');
</style>
